<?php
$pages = $this->pages;
?>

<ul>
    <?php foreach ($pages as $page): ?>
    <li id="<?php echo $page['id'] ?>">
        <a href="#"><?php echo $page['title'] ?></a>
        <?php if (count($page['children'])): ?>
        <?php echo $this->partial('/pages/tree.phtml', array('pages' => $page['children'])) ?>
        <?php endif; ?>
    </li>
    <?php endforeach; ?>
</ul>